<%@page import="com.uppalz.fundmanager.entities.FundMember"%>
<%@page import="com.uppalz.fundmanager.beans.MembersBean"%>
<%@page import="com.uppalz.fundmanager.beans.LoginBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    LoginBean loginBean = new LoginBean();
    if (!loginBean.isLoggedIn()) {
        loginBean.redirect(request, response);
        return;
    }

    MembersBean membersBean = new MembersBean();
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Fund Manager</title>
    </head>
    <body>
        <h1>Welcome <%=loginBean.getUserName()%> &lt;<%=loginBean.getEmail()%>&gt;!</h1>
        <ol>
            <%
                for (FundMember member : membersBean.get()) {
            %>
            <li>
                <%= member.getEmail()%>, <%= member.getName()%>, <%= member.getContactNumber()%>, <%= member.getJoiningDate()%>
            </li>
            <%
                }
            %>
        </ol>
    </body>
</html>
